package com.erpoa.entity;

import com.google.common.base.Objects;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.extern.slf4j.Slf4j;

import java.io.Serializable;
import java.util.List;

/**
 * Created by wanqi on 2016/8/13.
 *
 * @since 1.0.0
 */
@Data
@AllArgsConstructor
@Builder
@Slf4j
@EqualsAndHashCode
public class PackMessage implements Serializable {
    private String mTime;
    private String mMachine;
    private String mJobnum;
    private String mBarcode;


    private MgUser mUser;// 操作工

    private Integer mOptType;// 0:注塑 1:印刷 2:装配 3:油画棒        调拨：1查询   2 提交

    private Float mHandOverNum;// 交接量，生产交接专用的

    private String mWareHouse;// 生产入库专用
    private String mLibrary;// 生产入库专用

    private String mOrderNo;// 生产入库专用

    private Integer mPos;

    private GoodsEntity mGoods;//批次管理


    public String getOrderNo() {
        return mOrderNo;
    }

    public void setOrderNo(String orderNo) {
        mOrderNo = orderNo;
    }

    private List<String> mWorkers;// 多人产出专用

    private String mCrashLog;
    private String mLogFileName;

    private String mMessage;

    private String mStatus;   //入库专用 状态 保存/编辑

    public String getMessage() {
        return mMessage;
    }

    public String getStatus() {
        return mStatus;
    }

    public void setStatus(String status) {
        this.mStatus = status;
    }

    public void setMessage(String message) {
        mMessage = message;
    }

    public String getLogFileName() {
        return mLogFileName;
    }

    public void setLogFileName(String logFileName) {
        mLogFileName = logFileName;
    }

    public String getCrashLog() {
        return mCrashLog;
    }

    public void setCrashLog(String crashLog) {
        mCrashLog = crashLog;
    }

    public PackMessage() {
    }

    /**
     * 定量扫描所用的构造函数
     */
    public PackMessage(String time, String machine, String jobnum, String barcode, MgUser user, Integer type) {
        mTime = time;
        mMachine = machine;
        mJobnum = jobnum;
        mBarcode = barcode;
        mUser = user;
        mOptType = type;
    }

    /**
     * 生产交接所用的构造函数
     */
    public PackMessage(String time, String machine, String jobnum, String barcode, Float handOverNum, MgUser user) {
        mTime = time;
        mMachine = machine;
        mJobnum = jobnum;
        mBarcode = barcode;
        mUser = user;
        mHandOverNum = handOverNum;
    }

    /**
     * 生产报次所用的构造函数
     */
    public PackMessage(String time, String barcode, MgUser user) {
        mTime = time;
        mBarcode = barcode;
        mUser = user;
    }

    /**
     * 生产入库所用的构造函数
     */
    public PackMessage(String time, String barcode, MgUser user, String wareHouse, String library) {
        mTime = time;
        mBarcode = barcode;
        mUser = user;
        mWareHouse = wareHouse;
        mLibrary = library;
    }

    /**
     * 多人产出所用的构造函数
     */
    public PackMessage(String time, String barcode, MgUser user, String machine, List<String> workers) {
        mTime = time;
        mBarcode = barcode;
        mUser = user;
        mMachine = machine;
        mWorkers = workers;
    }

    public Float getHandOverNum() {
        return mHandOverNum;
    }

    public void setHandOverNum(Float handOverNum) {
        mHandOverNum = handOverNum;
    }

    public Integer getOptType() {
        return mOptType;
    }

    public void setOptType(Integer optType) {
        mOptType = optType;
    }

    public MgUser getUser() {
        return mUser;
    }

    public void setUser(MgUser user) {
        mUser = user;
    }

    public String getTime() {
        return mTime;
    }

    public void setTime(String time) {
        mTime = time;
    }

    public String getMachine() {
        return mMachine;
    }

    public void setMachine(String machine) {
        mMachine = machine;
    }

    public String getJobnum() {
        return mJobnum;
    }

    public void setJobnum(String jobnum) {
        mJobnum = jobnum;
    }

    public String getBarcode() {
        return mBarcode;
    }

    public void setBarcode(String barcode) {
        mBarcode = barcode;
    }

    public String getWareHouse() {
        return mWareHouse;
    }

    public void setWareHouse(String wareHouse) {
        mWareHouse = wareHouse;
    }

    public String getLibrary() {
        return mLibrary;
    }

    public void setLibrary(String library) {
        mLibrary = library;
    }

    public List<String> getWorkers() {
        return mWorkers;
    }

    public void setWorkers(List<String> workers) {
        mWorkers = workers;
    }

    public Integer getPos() {
        return mPos;
    }

    public void setPos(Integer pos) {
        mPos = pos;
    }

    public GoodsEntity getGoods() {
        return mGoods;
    }

    public void setGoods(GoodsEntity Goods) {
        mGoods = Goods;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        PackMessage that = (PackMessage) o;
        return Objects.equal(mTime, that.mTime) &&
                Objects.equal(mMachine, that.mMachine) &&
                Objects.equal(mJobnum, that.mJobnum) &&
                Objects.equal(mBarcode, that.mBarcode) &&
                Objects.equal(mUser, that.mUser) &&
                Objects.equal(mOptType, that.mOptType) &&
                Objects.equal(mHandOverNum, that.mHandOverNum) &&
                Objects.equal(mWareHouse, that.mWareHouse) &&
                Objects.equal(mLibrary, that.mLibrary) &&
                Objects.equal(mOrderNo, that.mOrderNo) &&
                Objects.equal(mPos, that.mPos) &&
                Objects.equal(mGoods, that.mGoods) &&
                Objects.equal(mWorkers, that.mWorkers) &&
                Objects.equal(mCrashLog, that.mCrashLog) &&
                Objects.equal(mLogFileName, that.mLogFileName) &&
                Objects.equal(mMessage, that.mMessage) &&
                Objects.equal(mStatus, that.mStatus);
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(mTime, mMachine, mJobnum, mBarcode, mUser, mOptType, mHandOverNum, mWareHouse, mLibrary, mOrderNo, mPos, mGoods, mWorkers, mCrashLog, mLogFileName, mMessage, mStatus);
    }

    @Override
    public String toString() {
        return "PackMessage{" +
                "mTime='" + mTime + '\'' +
                ", mMachine='" + mMachine + '\'' +
                ", mJobnum='" + mJobnum + '\'' +
                ", mBarcode='" + mBarcode + '\'' +
                ", mUser=" + mUser +
                ", mOptType=" + mOptType +
                ", mHandOverNum=" + mHandOverNum +
                ", mWareHouse='" + mWareHouse + '\'' +
                ", mLibrary='" + mLibrary + '\'' +
                ", mOrderNo='" + mOrderNo + '\'' +
                ", mPos=" + mPos +
                ", mGoods=" + mGoods +
                ", mWorkers=" + mWorkers +
                ", mCrashLog='" + mCrashLog + '\'' +
                ", mLogFileName='" + mLogFileName + '\'' +
                ", mMessage='" + mMessage + '\'' +
                ", mStatus='" + mStatus + '\'' +
                '}';
    }
}
